package com.taobao.api.request;

import java.util.Date;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.HanoiLabelQueryCountResponse;

/**
 * TOP API: taobao.hanoi.label.query.count request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class HanoiLabelQueryCountRequest implements TaobaoRequest<HanoiLabelQueryCountResponse> {

  private Map<String, String> headerMap = new TaobaoHashMap();
  private TaobaoHashMap       udfParams;                      // add
                                                              // user-defined
                                                              // text parameters
  private Long                timestamp;

  /**
   * 认证信息
   */
  private String              appName;

  /**
   * 模板业务状态 1 审核 0 创建
   */
  private Long                bizStatus;

  /**
   * 模板的编码
   */
  private String              code;

  /**
   * 根据时间查询 创建时间结束点
   */
  private Date                gmtCreateEnd;

  /**
   * 根据时间查询 创建时间截止点
   */
  private Date                gmtCreateStart;

  /**
   * 根据时间查询，最近修改时间截止
   */
  private Date                gmtModifiedEnd;

  /**
   * 根据时间查询，最近修改时间起点
   */
  private Date                gmtModifiedStart;

  /**
   * 模板id
   */
  private Long                id;

  /**
   * 模板名称
   */
  private String              name;

  /**
   * 开放策略
   */
  private Boolean             open;

  /**
   * 使用场景
   */
  private Long                scene;

  /**
   * 标签的源模板id
   */
  private Long                templateId;

  public void setAppName(String appName) {
    this.appName = appName;
  }

  public String getAppName() {
    return this.appName;
  }

  public void setBizStatus(Long bizStatus) {
    this.bizStatus = bizStatus;
  }

  public Long getBizStatus() {
    return this.bizStatus;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public String getCode() {
    return this.code;
  }

  public void setGmtCreateEnd(Date gmtCreateEnd) {
    this.gmtCreateEnd = gmtCreateEnd;
  }

  public Date getGmtCreateEnd() {
    return this.gmtCreateEnd;
  }

  public void setGmtCreateStart(Date gmtCreateStart) {
    this.gmtCreateStart = gmtCreateStart;
  }

  public Date getGmtCreateStart() {
    return this.gmtCreateStart;
  }

  public void setGmtModifiedEnd(Date gmtModifiedEnd) {
    this.gmtModifiedEnd = gmtModifiedEnd;
  }

  public Date getGmtModifiedEnd() {
    return this.gmtModifiedEnd;
  }

  public void setGmtModifiedStart(Date gmtModifiedStart) {
    this.gmtModifiedStart = gmtModifiedStart;
  }

  public Date getGmtModifiedStart() {
    return this.gmtModifiedStart;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getId() {
    return this.id;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getName() {
    return this.name;
  }

  public void setOpen(Boolean open) {
    this.open = open;
  }

  public Boolean getOpen() {
    return this.open;
  }

  public void setScene(Long scene) {
    this.scene = scene;
  }

  public Long getScene() {
    return this.scene;
  }

  public void setTemplateId(Long templateId) {
    this.templateId = templateId;
  }

  public Long getTemplateId() {
    return this.templateId;
  }

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "taobao.hanoi.label.query.count";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("app_name", this.appName);
    txtParams.put("biz_status", this.bizStatus);
    txtParams.put("code", this.code);
    txtParams.put("gmt_create_end", this.gmtCreateEnd);
    txtParams.put("gmt_create_start", this.gmtCreateStart);
    txtParams.put("gmt_modified_end", this.gmtModifiedEnd);
    txtParams.put("gmt_modified_start", this.gmtModifiedStart);
    txtParams.put("id", this.id);
    txtParams.put("name", this.name);
    txtParams.put("open", this.open);
    txtParams.put("scene", this.scene);
    txtParams.put("template_id", this.templateId);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Class<HanoiLabelQueryCountResponse> getResponseClass() {
    return HanoiLabelQueryCountResponse.class;
  }

  public void check() throws ApiRuleException {
    RequestCheckUtils.checkNotEmpty(appName, "appName");
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
